package fc.testmain;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.URL;
import java.net.URLConnection;
import java.util.Map;

import cn.hutool.http.HttpRequest;
import cn.hutool.json.JSONArray;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;



public class String转Map实例3 {

	public static void main(String[] args) {  
		
		
        String jsonString = HttpRequest.get("http://oa.maxwell-gp.com.cn:8090/api/fc_zh_pms/get_params?param_name=hrm_bymobile&mobile=18706207589").execute().body();
 
        System.out.println(jsonString);
		String out;
        Object succesResponse = JSON.parse(jsonString);    //先转换成Object
        Map map = (Map)succesResponse;  
        String oaid="";
        JSONArray jsonArray = new JSONArray(map.get("result"));
        for( int i=0;i<jsonArray.size();i++){
       	 	 System.out.println("第"+(i+1)+"条开始.........");
       	 	 System.out.println(jsonArray.get(i));
       	 	 JSONObject info = new JSONObject((Map<String, Object>) jsonArray.get(i));
       	 	 if("在职".equals(info.get("status"))){
       	 		oaid=(String) info.get("id");
       	 		break;
       	 	 } 
        }
        System.out.println(oaid+"////");
	}

}
